<?php
    require_once '../connect.php';
    $title=$_POST['title'];
    $price = $_POST['price'];
    $sql="INSERT INTO library(title,price) VALUES('$title',$price)";
//     if(mysqli_query($con, $sql))
//     {
//         echo "success!";
//     }
    if(mysqli_query($con,$sql)){
         echo "<script>alert('add success!');</script>";
        echo "<script>window.location.href='manage.php';</script>";
    }else{
        echo "<script>alert('add failed!');</script>";
        echo "<script>window.location.href='manage.php';</script>";
    
    }